feat: Stellar submission failures metrics#670
Conversation
|
Important Review skippedAuto incremental reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
WalkthroughThis PR enhances Stellar transaction submission error handling with XDR result code decoding and improved metrics tracking. A new utility function decodes transaction error XDR, the submission flow captures decoded error codes with detailed labeling, and a new Prometheus metric tracks submission failures by status and result code. Changes
Sequence DiagramsequenceDiagram
participant Client
participant SubmissionHandler as Submit Handler
participant Provider as Stellar Provider
participant Decoder as XDR Decoder
participant Metrics as Metrics Registry
Client->>SubmissionHandler: Submit transaction
SubmissionHandler->>Provider: Call submit_transaction
alt Provider Error
Provider-->>SubmissionHandler: Error response
SubmissionHandler->>Metrics: Increment STELLAR_SUBMISSION_FAILURES<br/>[provider_error]
SubmissionHandler-->>Client: TransactionError
else TRY_AGAIN_LATER
Provider-->>SubmissionHandler: TRY_AGAIN_LATER status
SubmissionHandler->>Metrics: Increment STELLAR_SUBMISSION_FAILURES<br/>[try_again_later, n/a]
SubmissionHandler-->>Client: Failure result
else ERROR with XDR
Provider-->>SubmissionHandler: ERROR + error_result_xdr
SubmissionHandler->>Decoder: decode_tx_result_code(xdr)
Decoder-->>SubmissionHandler: result_code (e.g., "TxBadSeq")
SubmissionHandler->>Metrics: Increment STELLAR_SUBMISSION_FAILURES<br/>[error, result_code]
SubmissionHandler-->>Client: Detailed error with code
else Unknown Status
Provider-->>SubmissionHandler: Unknown status
SubmissionHandler->>Metrics: Increment STELLAR_SUBMISSION_FAILURES<br/>[unknown_status, n/a]
SubmissionHandler-->>Client: Unknown error
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
📝 Coding Plan
Comment Tip You can customize the high-level summary generated by CodeRabbit.Configure the |
Codecov Report❌ Patch coverage is
Additional details and impacted files
Flags with carried forward coverage won't be shown. Click here to find out more. @@ Coverage Diff @@
## main #670 +/- ##
==========================================
- Coverage 90.97% 90.97% -0.01%
==========================================
Files 288 288
Lines 118548 118596 +48
==========================================
+ Hits 107852 107887 +35
- Misses 10696 10709 +13
🚀 New features to boost your workflow:
|
Summary
Track stellar submission failures and their reasons
Testing Process
Checklist
Note
If you are using Relayer in your stack, consider adding your team or organization to our list of Relayer Users in the Wild!
Summary by CodeRabbit
Bug Fixes
Tests